﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="create-account.aspx.cs" Inherits="admin_admins_create_account" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">
    <div class="page-header">
    <h1>Create Account</h1>
</div>
<div>
<p class="text-info">Use this form to create an ACS executive account</p>
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
            CreateUserButtonText="Submit" DisableCreatedUser="True" 
            FinishDestinationPageUrl="~/admin/Default.aspx" LoginCreatedUser="False" 
        oncreateduser="CreateUserWizard1_CreatedUser" onsendingmail="CreateUserWizard1_SendingMail" >
            <CreateUserButtonStyle CssClass="btn" />
            <MailDefinition From="no-reply@acs-membership.com" BodyFileName="~/files/newadmin.txt" 
                Priority="High" Subject="Your ACS Login Details">
            </MailDefinition>
            <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" Title="">
                    <ContentTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username</asp:Label>
                                    <asp:TextBox ID="UserName" runat="server" data-mini="true" ></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                        ControlToValidate="UserName" ErrorMessage="User Name is required." 
                                        ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password</asp:Label>
                                    <asp:TextBox ID="Password" runat="server" TextMode="Password" data-mini="true" ></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                        ControlToValidate="Password" ErrorMessage="Password is required." 
                                        ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                        AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                                    <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" data-mini="true" ></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                        ControlToValidate="ConfirmPassword" 
                                        ErrorMessage="Confirm Password is required." 
                                        ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail</asp:Label>
                                    <asp:TextBox ID="Email" runat="server" data-mini="true" ></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                        ControlToValidate="Email" ErrorMessage="E-mail is required." 
                                        ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="UniLabel" runat="server" AssociatedControlID="UniDropDownList">Institution</asp:Label>
                                    <asp:DropDownList ID="UniDropDownList" runat="server" data-mini="true"  
                                        AppendDataBoundItems="True" DataSourceID="SqlDataSource2" 
                                        DataTextField="UNIVERISTY_NAME" DataValueField="ID">
                                        <asp:ListItem></asp:ListItem>
                                        <asp:ListItem Value="Global">Global</asp:ListItem>
                                    </asp:DropDownList>
                                    <br />
                                    
                                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                                        SelectCommand="SELECT * FROM [UNIVERSITIES]"></asp:SqlDataSource>
                                    <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                        ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                        Display="Dynamic" 
                                        ErrorMessage="The Password and Confirmation Password must match." 
                                        ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                    <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                    <CustomNavigationTemplate>
                        <table border="0" cellspacing="5" style="width:100%;height:100%;">
                            <tr align="right">
                                <td align="right" colspan="0">
                                    <asp:Button ID="StepNextButton" runat="server"  CommandName="MoveNext" data-ajax="false"
                                        CssClass="btn" Text="Submit" ValidationGroup="CreateUserWizard1" />
                                </td>
                            </tr>
                        </table>
                    </CustomNavigationTemplate>
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                    <ContentTemplate>
                        <div class="alert alert-success">
                            <h4>Success!</h4>
                            Admin account has been created. You must approve the account before it can be used. <a href="admins.aspx">click here to approve</a><br />
                            <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue" 
                                        Text="Continue" ValidationGroup="CreateUserWizard1" CssClass="btn" />
                        </div>
                    </ContentTemplate>
                </asp:CompleteWizardStep>
            </WizardSteps>
        </asp:CreateUserWizard>
</div>
</asp:Content>

